import random
print('*'*20,'欢迎进入猜拳游戏界面','*'*20)
print()
print('*'*50)
print('出拳规则: 1.剪刀 2.石头 3.布 ')
print('*'*50)
role=input('请选择对战角色: 1.刘备 2.曹操 3.孙权 :')
comp_name=''
if role == '1' :
    comp_name = '刘备'
elif role == '2':
    comp_name = '曹操'
elif role == '3':
    comp_name = '孙权'
play_name = input('请输入你的姓名：')
print()
print(f'{play_name} 将和 {comp_name} 进行对战')
print('-'*50)
flag=True
play_score = 0
comp_score = 0
while flag :
    play_choose=int(input('请出拳:[1.剪刀 2.石头 3.布] : '))
    comp_choose = random.randint(1,3)
    if play_choose == 1 and comp_choose == 3 \
    or play_choose ==2 and comp_choose==1 \
    or play_choose==3 and comp_choose==2:
        print('恭喜你，你赢了')
        play_score += 1
    elif play_choose == comp_choose :
        print('还好还好，平局')
    else :
        print('真笨，你输了')
        comp_score += 1
    answer=input('你还想继续玩吗? y/n : ')
    if answer == 'n':
        flag=False


print('*'*20,'对战结果','*'*20)
print()
print(f'你[{play_name}] VS {comp_name}')
print()
print(f'{play_score}   VS {comp_score}')


